package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ConsoleNewsCommentMapper;
import com.ruoyi.system.domain.ConsoleNewsComment;
import com.ruoyi.system.service.IConsoleNewsCommentService;

/**
 * 评论Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-27
 */
@Service
public class ConsoleNewsCommentServiceImpl implements IConsoleNewsCommentService 
{
    @Autowired
    private ConsoleNewsCommentMapper consoleNewsCommentMapper;

    /**
     * 查询评论
     * 
     * @param id 评论主键
     * @return 评论
     */
    @Override
    public ConsoleNewsComment selectConsoleNewsCommentById(Long id)
    {
        return consoleNewsCommentMapper.selectConsoleNewsCommentById(id);
    }

    /**
     * 查询评论列表
     * 
     * @param consoleNewsComment 评论
     * @return 评论
     */
    @Override
    public List<ConsoleNewsComment> selectConsoleNewsCommentList(ConsoleNewsComment consoleNewsComment)
    {
        return consoleNewsCommentMapper.selectConsoleNewsCommentList(consoleNewsComment);
    }

    /**
     * 新增评论
     * 
     * @param consoleNewsComment 评论
     * @return 结果
     */
    @Override
    public int insertConsoleNewsComment(ConsoleNewsComment consoleNewsComment)
    {
        consoleNewsComment.setCreateTime(DateUtils.getNowDate());
        return consoleNewsCommentMapper.insertConsoleNewsComment(consoleNewsComment);
    }

    /**
     * 修改评论
     * 
     * @param consoleNewsComment 评论
     * @return 结果
     */
    @Override
    public int updateConsoleNewsComment(ConsoleNewsComment consoleNewsComment)
    {
        return consoleNewsCommentMapper.updateConsoleNewsComment(consoleNewsComment);
    }

    /**
     * 批量删除评论
     * 
     * @param ids 需要删除的评论主键
     * @return 结果
     */
    @Override
    public int deleteConsoleNewsCommentByIds(Long[] ids)
    {
        return consoleNewsCommentMapper.deleteConsoleNewsCommentByIds(ids);
    }

    /**
     * 删除评论信息
     * 
     * @param id 评论主键
     * @return 结果
     */
    @Override
    public int deleteConsoleNewsCommentById(Long id)
    {
        return consoleNewsCommentMapper.deleteConsoleNewsCommentById(id);
    }
}
